# -*- coding: utf-8 -*-
# @project: huawang-api20230914
# @file： StoreManagePage.py
# @Time：2023/9/20 14:45
# @Author：liaogan
from time import sleep

import allure

from common.commin.basePage import BasePage

"""门店列表页面"""

class StoreList(BasePage):
    """编辑会员列表信息"""

    @allure.step('编辑会员列表信息')
    def Edit_StoreList(self):
        self.input_text(self.Storename_input, 15218701897, desc="输入手机号")
        self.click_element(self.search_button, desc="点击搜索")
        self.click_element(self.Sign_OUT_button, desc="点击注销")
        self.click_element(self.verify_button1, desc="点击确认")
        sleep(2)
        self.click_element(self.Activate_button1, desc="点击激活")
        self.click_element(self.verify_button2, desc="点击确认")
        sleep(2)
        self.click_element(self.freeze_button, desc="点击冻结")
        self.click_element(self.verify_button3, desc="点击确认")
        sleep(2)
        self.click_element(self.Activate_button2, desc="点击激活")
        self.click_element(self.verify_button4, desc="点击确认")
        sleep(2)

    """充值花豆"""
    @allure.step('充值店主花豆')
    def rechage_Broadbean(self):
        self.click_element(self.rechage_Broadbeanel, desc="点击充值花豆")
        sleep(1)
        self.click_element(self.income, desc="点击收入")
        self.input_text(self.salary, 999, desc="输入金额")
        self.input_text(self.remark, "2023充值", desc="输入充值备注")
        sleep(2)
        self.click_element(self.verify_button5, desc="点击确认")
        return StoreList()


    """编辑会员信息"""

    @allure.step('编辑店主信息')
    def Edit_Menber_information(self,nickname,name,Idnnumber,SalesmanCode,SalesmanName,DetailedAddress):
        self.click_element(self.edit_button,desc="点击编辑")
        sleep(1)
        self.input_text(self.store_input,nickname,desc="门店昵称")
        self.input_text(self.storenickname_input,name,desc="姓名")
        self.input_text(self.Id_number_input,Idnnumber,desc="身份证号")
        self.click_element(self.store2,desc="点击门店类型")
        sleep(0.5)
        self.click_element(self.yunke,desc="点击云客")
        self.input_text(self.Salesman_code_input,SalesmanCode,desc="销售人编号")
        self.input_text(self.Salesman_name_input,SalesmanName,desc="销售人姓名")
        self.input_text(self.Detailed_address_input,DetailedAddress,desc="详细地址")
        self.click_element(self.verify_button6,desc="点击确认")
        sleep(0.5)
        return StoreList()


    """获取删除成功tips"""
    @allure.step('获取Tips提示消息')
    def Get_Tips(self):
        return self.get_element_text(self.get_tips1, desc="编辑成功Tips提示")
